{% extends 'base/base.html' %}

{% block title %}删除监测数据 - 环保监测数据管理系统{% endblock %}

{% block content %}
<div class="container-fluid">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h1 class="h2">删除监测数据</h1>
        <div>
            <a href="{% url 'monitoring:data_list' %}" class="btn btn-secondary">
                <i class="fas fa-arrow-left"></i> 返回列表
            </a>
        </div>
    </div>
    
    <div class="card shadow mb-4">
        <div class="card-header py-3">
            <h6 class="m-0 font-weight-bold text-danger">确认删除</h6>
        </div>
        <div class="card-body">
            <div class="alert alert-warning">
                <p>您确定要删除以下监测数据吗？</p>
                <ul>
                    <li><strong>监测类别：</strong>{{ data.category.name }}</li>
                    <li><strong>监测地点：</strong>{{ data.location }}</li>
                    <li><strong>监测值：</strong>{{ data.value }} {{ data.unit }}</li>
                    <li><strong>监测时间：</strong>{{ data.measured_at|date:"Y-m-d H:i" }}</li>
                </ul>
                <p class="text-danger">
                    <i class="fas fa-exclamation-triangle"></i> 
                    警告：此操作不可逆，删除后数据将无法恢复！
                </p>
            </div>
            <form method="post">
                {% csrf_token %}
                <div class="d-grid gap-2 d-md-flex justify-content-md-end">
                    <a href="{% url 'monitoring:data_detail' data.id %}" class="btn btn-secondary me-md-2">
                        <i class="fas fa-times"></i> 取消
                    </a>
                    <button type="submit" class="btn btn-danger">
                        <i class="fas fa-trash"></i> 确认删除
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
{% endblock %}